package com.punch.oauth.exception;


import com.punch.common.exception.ExceptionEnum;

/**
 * 系统模块自定义异常枚举
 *
 * @author cyd
 * @since 2019-12-05
 */
public enum UaaExceptionEnum implements ExceptionEnum {


    WX_LOGIN_ERROR(8000, "小程序登录异常"),

    WX_ACCESS_TOKEN_ERROR(8001, "获取AccessToken错误"),

    WX_DECRYPT_ERROR(8002, "微信解密用户信息错误"),

    CAPTCHA_TIME_OUT(8003, "验证码过期"),

    CAPTCHA_ERROR(8004, "验证码错误"),

    EXCEED_PASSWORD_ERROR_TIME(8005, "错误次数超过5次"),

    NO_SET_PASSWORD(8006, "暂未设置密码"),

    ;

    private int code;
    private String msg;

    /**
     * 构造方法
     *
     * @param code    异常编码
     * @param message 异常信息
     * @author cyd
     * @since 2019-12-05
     */
    UaaExceptionEnum(int code, String message) {
        this.code = code;
        this.msg = message;
    }

    /**
     * 获取异常编码
     */
    @Override
    public Integer getCode() {
        return code;
    }

    /**
     * 获取异常信息
     */
    @Override
    public String getMsg() {
        return msg;
    }


}
